package com.hjh.demo;

public class Biaozhun {


    public static void check(Integer[] array) {
        int sum = 0;
        for (int i = 0; i < array.length; i++) {
            sum += array[i];      //求出数组的总和
        }
        System.out.println(sum);  //939
        double average = sum / array.length;  //求出数组的平均数
        //System.out.println(average);   //52.0
        int total = 0;
        for (int i = 0; i < array.length; i++) {
            total += (array[i] - average) * (array[i] - average);   //求出方差，如果要计算方差的话这一步就可以了
        }
        double standardDeviation = Math.sqrt(total / array.length);   //求出标准差
        System.out.println(standardDeviation);    //32.55764119219941

    }

}